import type {
  LoginParam,
  UserInfo,
  UserListParams,
  UserListData,
  UserAddData,
} from '@/types/user'
import request from '@/utils/request'

export const uri = {
  loginName: '/web/index/login', // 用户名登录
  userList: '/web/user/list', // 用户列表
  userAdd: '/web/user/add', // 用户添加
}

export const postLoginName = (data: LoginParam) => {
  return request<UserInfo>(uri.loginName, 'POST', data)
}

export const getUserList = (data: UserListParams) => {
  return request<UserListData>(uri.userList, 'POST', data)
}

export const postUserAdd = (data: UserAddData) => {
  return request<void>(uri.userAdd, 'POST', data)
}
